/**
 * 
 */
package x.java.util.zip;

import java.io.File;
import java.io.IOException;
import java.util.zip.ZipException;

/**
 * @author qiangli
 * 
 */
public class ZipFile extends java.util.zip.ZipFile {
	private x.java.io.File file = null;
	/**
	 * @param name
	 * @throws IOException
	 */
	public ZipFile(String name) throws IOException {
		this(new x.java.io.File(name), OPEN_READ);
	}

	/**
	 * @param file
	 * @throws ZipException
	 * @throws IOException
	 */
	public ZipFile(File file) throws ZipException, IOException {
		this((x.java.io.File)file, OPEN_READ);
	}

	/**
	 * @param file
	 * @param mode
	 * @throws IOException
	 */
	public ZipFile(File file, int mode) throws IOException {
		this((x.java.io.File)file, mode);
	}

	private ZipFile(x.java.io.File file, int mode) throws IOException {
		super(file.replicate(), mode);
		this.file = file;
	}

	
	public void close() throws IOException {
		super.close();
		new java.io.File(super.getName()).delete();
	}

	public String getName() {
		return file.getPath();
	}
}
